<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>easyui_3</title>
    <link type="text/css" rel="stylesheet" href="static/easyui/themes/default/easyui.css"/>
    <link type="text/css" rel="stylesheet" href="static/easyui/themes/icon.css"/>
    <script type="text/javascript" src="static/js/jquery.min.js"></script>
    <script type="text/javascript" src="static/easyui/jquery.easyui.min.js"></script>

</head>
<body>
    <table id="weapon" class="easyui-datagrid" title="大规模杀伤性武器" style="width: 440px;height:200px;"
           data-options="singleSelect:true,collapsible:true">
        <thead>
            <tr>
                <th data-options="field:'mark',width:'80'">编号</th>
                <th data-options="field:'name',width:'100'">名称</th>
                <th data-options="field:'productField',width:'80'">产地</th>
                <th data-options="field:'destoryForce',width:120">破坏力</th>
                <th data-options="field:'weight',width:'60'">重量</th>
            </tr>
        </thead>
    </table>
    <input id="wu" class="easyui-textbox" data-options="onChange:ifYouHaveChangedValue"/>
    <script>

        function ifYouHaveChangedValue(newVale,oldValue) {
            alert(newValue);
        }
        function onSelectFunc(index,row) {
            $("#wu").textbox("setValue","中华人民共和国");
            alert(row.name);
        }
        $(function () {
            var json_data=[
                {mark:'1001',name:'尼泊尔军刀',productField:'尼泊尔',destoryForce:'100',weight:'0.8kg'},
                {mark:'1002',name:'爱国者导弹',productField:'米国',destoryForce:'10000',weight:'180kg'},
                {mark:'1003',name:'喀秋莎火箭炮',productField:'俄罗斯',destoryForce:'10000',weight:'200kg'},
                {mark:'1004',name:'德克萨斯号战列舰',productField:'米国',destoryForce:'7000000',weight:'20000t'},
                {mark:'1001',name:'VT-4主战坦克',productField:'中国',destoryForce:'2000000',weight:'43t'},
                {mark:'1001',name:'卡卡罗特',productField:'日本',destoryForce:'无法计算',weight:'80kg'},
                {mark:'1001',name:'喷子',productField:'今日头条',destoryForce:'杀伤半径无法计算',weight:'可以忽略不计'},
            ];
            $("#weapon").datagrid({
                data:json_data,
                onSelect:onSelectFunc
            });
        });

    </script>
</body>
</html>